package com.xxxx.service.impl;

import com.xxxx.dao.OrderDao;
import com.xxxx.pojo.Order;
import com.xxxx.service.OrderService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created By ShaoXikai on 2022/7/24
 */
@Service
public class OrderServiceImpl implements OrderService {

    private OrderDao orderDao;

    public void setOrderDao(OrderDao orderDao) {
        this.orderDao = orderDao;
    }

    @Override
    public List<Order> findAllOrder() {
        return orderDao.selectAllOrder();
    }

    @Override
    public int saveOrder(Order order) {
        return orderDao.insertOrder(order);
    }

    @Override
    public int remove(Long id) {
        return orderDao.deleteByIdOrder(id);
    }

    @Override
    public int modifyOrder(Order order) {
        return orderDao.updateOrder(order);
    }

    @Override
    public Order findOrderById(Long id) {
        return orderDao.selectOrderById(id);
    }

    @Override
    public int removeByDoorId(Long id) {
        return orderDao.deleteByDoorId(id);
    }
}
